using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class user_numberMap : EntityTypeConfiguration<user_number>
    {
        public user_numberMap()
        {
            // Primary Key
            this.HasKey(t => t.user_type_name);

            // Properties
            this.Property(t => t.user_type_name)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.description)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("user_number");
            this.Property(t => t.user_type_name).HasColumnName("user_type_name");
            this.Property(t => t.user_type_number).HasColumnName("user_type_number");
            this.Property(t => t.description).HasColumnName("description");
        }
    }
}
